/*
 * NCSTCPServer.h
 *
 *  Created on: Apr 16, 2017
 *      Author: zhangjf
 */

#ifndef SRC_NETWORKSUBSYSTEM_NCSTCPSERVER_H_
#define SRC_NETWORKSUBSYSTEM_NCSTCPSERVER_H_

#include <Poco/AutoPtr.h>
#include <Poco/Runnable.h>
#include <Poco/Task.h>
#include <Poco/Logger.h>
#include <Poco/Net/TCPServer.h>

#include <memory>

using namespace Poco;
using namespace Poco::Net;

namespace network
{

class NCSTCPServer : public Task
{
public:
	NCSTCPServer(NotificationQueue& nq);
	virtual ~NCSTCPServer();

	bool initialize();

	void runTask();

	void stop();

private:
	NotificationQueue& _nq;
	TCPServer* _pTCPServer = nullptr;
};

} /* namespace network */

#endif /* SRC_NETWORKSUBSYSTEM_NCSTCPSERVER_H_ */
